package Abstract02;
//匿名内部类
public class Test {
    public static void main(String[] args) {
        //有名字的匿名内部类
        Animal a = new Animal() {
            @Override
            public void eat() {
                System.out.println("糟蹋狗粮");
            }
        };
        a.eat();


        //匿名对象的匿名内部类
        new Animal() {
            @Override
            public void eat() {
                System.out.println("狂撒狗粮");
            }
        }.eat();

    }
}

